home *** CD-ROM | disk | FTP | other *** search
- Path: news.ov.com!news
- From: glenn@ov.com (Fletcher.Glenn@ov.com)
- Newsgroups: comp.lang.c
- Subject: Re: need for function prototypes
- Date: 29 Feb 1996 23:20:17 GMT
- Organization: OpenVision
- Message-ID: <4h5cbh$2pi@spanky.pls.ov.com>
- References: <4gutho$o1a@mn5.swip.net>
- Reply-To: glenn@ov.com
- NNTP-Posting-Host: foghorn.pls.ov.com
-
- In article o1a@mn5.swip.net, chris.rossall@mailbox.swipnet.se (Chris Rossall) writes:
- >Hello I am having trouble understanding why I should use function
- >prototypes. I mean,if the function is defined before it is used,the
- >compiler should have enough information about the parameters to
- >produce correct code anyway.
- >
- >-Chris
- >
-
-
- Yes, but what about the following cases:
-
- 1. The function is defined in another code module. Without prototypes, how
- would the compiler know how to link with the function? This is also
- true of library calls (usually prototyped in a header file).
-
- 2. The function is defined later in the program source. A function prototype
- allows you to put higher level (and therefore more understandable) stuff
- at the beginning of your source file.
-
- Fletcher.Glenn@ov.com
-
-